#include <stdio.h>
#include <stdlib.h>
#include <string.h>



int main(int argc, char *argv[])
{
	if (argc < 2) {
		fprintf(stderr, "Usage %s <file_path>\n", argv[0]);
		exit(1);
	}

	FILE *fp;

	if ((fp = fopen(argv[1], "r")) == NULL) {
		perror("fopen()");
		exit(1);
	}

	// below is important!!
	char *linebuf = NULL;
	size_t line_size = 0;

	while (1) {
		if (getline(&linebuf, &line_size, fp) < 0) {
			break;
		}
		printf("%d\n", (int) strlen(linebuf));
	}
	
	fclose(fp);

	exit(0);
}
